<html>
<head><meta charset="utf-8"><title>Is codegen-units+ThinLTO still problematic? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html">Is codegen-units+ThinLTO still problematic?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="136484303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136484303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136484303">(Oct 25 2018 at 15:14)</a>:</h4>
<p>Early this year we had issues with codegen-units + ThinLTO not being as good as codegen-units=1. We thus filled <a href="https://github.com/rust-lang/rust/issues/47745" target="_blank" title="https://github.com/rust-lang/rust/issues/47745">https://github.com/rust-lang/rust/issues/47745</a>. I haven’t seen more reports in recent time (esp. after LLVM upgrade). Could this be solved now? Should check…</p>



<a name="136545158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136545158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136545158">(Oct 26 2018 at 13:00)</a>:</h4>
<p>Given that switching libstd from ThinLTO to 1 codegen-unit gives a noticeable speedup, I guess that 1 CGU is still the better option for runtime performance: <a href="https://github.com/rust-lang/rust/pull/55264#issuecomment-432323933" target="_blank" title="https://github.com/rust-lang/rust/pull/55264#issuecomment-432323933">https://github.com/rust-lang/rust/pull/55264#issuecomment-432323933</a></p>



<a name="136563390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136563390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136563390">(Oct 26 2018 at 17:58)</a>:</h4>
<p>sad</p>



<a name="136563403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136563403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136563403">(Oct 26 2018 at 17:58)</a>:</h4>
<p>these are the times when I feel like the "debug vs release" dichotomy is a bit too strong</p>



<a name="136563436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136563436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136563436">(Oct 26 2018 at 17:59)</a>:</h4>
<p>but every time I try to chase down what it means to have a third level I wind up thinking that debug vs release is ok, we just need to make debug generate "mildly optimized" code</p>



<a name="136563445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136563445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136563445">(Oct 26 2018 at 17:59)</a>:</h4>
<p>still, <span class="user-mention" data-user-id="124287">@mw</span>, those perf numbers are not <em>that</em> different — clearly 1 CGU is better but there have to be a lot of use cases for which it's worth it</p>



<a name="136705073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136705073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136705073">(Oct 29 2018 at 13:20)</a>:</h4>
<p>Yeah, we generally treat the issue as "solved" because we default to ThinLTO for release builds anyway</p>



<a name="136720267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136720267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136720267">(Oct 29 2018 at 17:07)</a>:</h4>
<p>ok ok</p>



<a name="136720307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136720307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136720307">(Oct 29 2018 at 17:08)</a>:</h4>
<p>so basically "by default" you don't get the "max perf" setting</p>



<a name="136720324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136720324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136720324">(Oct 29 2018 at 17:08)</a>:</h4>
<p>i'd be really great to have these workflows documented :/</p>



<a name="136720331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136720331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136720331">(Oct 29 2018 at 17:08)</a>:</h4>
<p>well, maybe we do</p>



<a name="136720336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Is%20codegen-units%2BThinLTO%20still%20problematic%3F/near/136720336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Is.20codegen-units.2BThinLTO.20still.20problematic.3F.html#136720336">(Oct 29 2018 at 17:08)</a>:</h4>
<p>I just imagine people running benchmarks and not knowing this :) seems easy to imagine</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>